#ifndef _PACKET_HPP
#define _PACKET_HPP

#include <string>
#include <vector>
#include <cstdint>

namespace phx
{

typedef int16_t Short;
typedef uint16_t UShort;
typedef int32_t Int;
typedef uint32_t UInt;
typedef int64_t Long;
typedef uint64_t ULong;

class Packet
{
public:
	Packet();

	void append(Int data);
	void append(std::string &data);
	bool extract(Int &copyTo);
	bool extract(std::string &copyTo);

	Packet& operator<<(Int data);
	Packet& operator<<(std::string &data);
	Packet& operator>>(Int &copyTo);
	Packet& operator>>(std::string &copyTo);

	//friend class NetworkClient;
	//friend class NetworkServer;
private:
	void setData(const char *data, size_t size);
private:
	std::string mData;
};

}

#endif